package net.csdn.business.common.domain.issue.event;

import lombok.Data;
import lombok.experimental.SuperBuilder;
import net.csdn.business.common.domain.issue.IssueActionTextEnum;
import net.csdn.business.common.domain.issue.IssueExt;

import java.io.Serializable;

/**
 * @author likun
 * @date 2022/11/16 16:54
 */
@Data
@SuperBuilder
public abstract class BaseEventDto implements Serializable {
    private String id;

    /**
     * notify event 这个UID可能是操作人ID（操作人可以统一到 actionUid）
     */
    private String uid;
    private Long projectId;

    private Integer serialNumber;

    private String title;

    /**
     * 操作人
     */
    private String actionUid;

    private Integer actionUserType;

    private IssueExt ext;

    /**
     * 记录到对应的change中
     */
    private IssueActionTextEnum actionText;

    public BaseEventDto(String id, String uid, Long projectId, Integer serialNumber, String title) {
        this.id = id;
        this.uid = uid;
        this.projectId = projectId;
        this.serialNumber = serialNumber;
        this.title = title;
    }

    public BaseEventDto(String id, String actionUid, Integer actionUserType, Long projectId, Integer serialNumber, String title) {
        this.id = id;
        this.actionUid = actionUid;
        this.actionUserType = actionUserType;
        this.projectId = projectId;
        this.serialNumber = serialNumber;
        this.title = title;
    }

    public BaseEventDto(String id, String uid, Long projectId, Integer serialNumber, String title, String actionUid) {
        this.id = id;
        this.uid = uid;
        this.projectId = projectId;
        this.serialNumber = serialNumber;
        this.title = title;
        this.actionUid = actionUid;
    }

    public BaseEventDto() {
    }
}